package com.scuec.tourismwebsite.service;

import com.scuec.tourismwebsite.entity.FreeformPostFavorite;
import com.scuec.tourismwebsite.mapper.FreeformPostFavoriteMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class FreeformPostFavoriteServiceImpl implements FreeformPostFavoriteService{
    @Autowired
    private FreeformPostFavoriteMapper freeformPostFavoriteMapper;
    @Override
    public int deleteFreeformPostFavorite(int user_id, int post_id) {
        return freeformPostFavoriteMapper.deleteFreeformPostFavorite(user_id, post_id);
    }

    @Override
    public List<FreeformPostFavorite> selectFreeformPostFavoriteById(int user_id, int post_id) {
        return freeformPostFavoriteMapper.selectFreeformPostFavoriteById(user_id, post_id);
    }

    @Override
    public int insertFreeformPostFavorite(@Param("user_id") int user_id, @Param("post_id") int post_id) {
        return freeformPostFavoriteMapper.insertFreeformPostFavorite(user_id, post_id);
    }
}
